<?php
/* functions gia ontotites users , customers */

// Dimiourgia xristi ( ipallilou )
function user_create($user_name, $user_surname, $user_address,$user_email, $user_phone,$user_username,$user_password,$user_role)
{            
               
	$userCreate = "INSERT INTO users( user_name, user_surname, user_address,user_email, user_phone,user_username,user_password,user_role) 
	VALUES ('$user_name', '$user_surname', '$user_address','$user_email', '$user_phone','$user_username','$user_password','$user_role')";
    $result = mysql_query( $userCreate );
	if ( !$result )
        die ( 'Database error : ' . mysql_error() );
      
    
    return $result;
}
// Dimiourgia xristi ( pelati )
function customer_create($customer_name, $customer_surname, $customer_address,$customer_floor, $customer_phone,$customer_username,$customer_password)
{            
               
	$customerCreate = "INSERT INTO customer( customer_name, customer_surname, customer_address,customer_floor, customer_phone,customer_username,customer_password )
	VALUES ('$customer_name',' $customer_surname',' $customer_address',$customer_floor', '$customer_phone','$customer_username','$customer_password')";
    $result = mysql_query( $userCreate );
	if ( !$result )
        die ( 'Database error : ' . mysql_error() );
      
    
    return $result;
}

/* functions gia update users, customes */

// Update xtisti ( ipallilou )
function user_update($user_name, $user_surname, $user_address,$user_email, $user_phone,$user_username,$user_password,$user_role)
{            
               
	$userUpdate = "Update users set ( user_name, user_surname, user_address,user_email, user_phone,user_username,user_password,user_role) 
	VALUES ('$user_name', '$user_surname', '$user_address','$user_email', '$user_phone','$user_username','$user_password','$user_role')";
    $result = mysql_query( $userUpdate );
	if ( !$result )
        die ( 'Database error : ' . mysql_error() );
      
    
    return $result;
}
	
// Update xtisti ( pelati )
function customer_update($customer_name, $customer_surname, $customer_address,$customer_floor, $customer_phone,$customer_username,$customer_password)
{            
               
	$userUpdate = "Update customer set( customer_name, customer_surname, customer_address,customer_floor, customer_phone,customer_username,customer_password) 
	VALUES ('$customer_name',' $customer_surname',' $customer_address',$customer_floor', '$customer_phone','$customer_username','$customer_password')";
    $result = mysql_query( $userUpdate );
	if ( !$result )
        die ( 'Database error : ' . mysql_error() );
      
    
    return $result;
}	



	
?>